
*Replication of tables 2 and 3 of Labor Market Segmentation Influences Fatalities in Construction



eststo clear
quietly: nbreg total_fatal_ind A_Mem con_grad_union con_grad_non tot_act_union tot_act_non ///
wage unem_rate emp_23  emp_size emp_size_qr i.id i.year if year >= 2003, vce(robust)

estpost sum total_fatal_ind A_Mem tot_act con_grad con_grad_union con_grad_non tot_act_union tot_act_non ///
 emp_23 unem_rate  emp_size emp_size_qr  if sample_index == 1

esttab using "Paper 2_12-19 Peter descriptive statistics.rtf",  cell((mean(fmt(%9.1f)) sd(fmt(%9.2f)))) nonumber nomtitle ///
order(total_fatal_ind A_Mem tot_act con_grad tot_act_union con_grad_union ///
tot_act_non  con_grad_non) ///
coeflabels(total_fatal_ind "Fatal Injury Count" A_Mem "Unionization Rate" tot_act "Tot Active" con_grad "Graduation" tot_act_union "Tot Active Union" ///
con_grad_union "Graduation Union" tot_act_non "Tot Active Nonunion"  con_grad_non "Graduation Nonunion " ///
wage "Annual Wage Income" unem_rate "Unemployment Rate" emp_size "Contractor Size" emp_size_qr "Contractor Size Sqr" ///
emp_23 "Employment") nonumber nomtitle varwidth(20) replace


*Table 3
eststo clear

*model 1
nbreg total_fatal_ind A_Mem con_grad emp_23 unem_rate emp_size emp_size_qr  i.id i.year  if year >= 2003 , vce(robust)
estadd local state "Yes"
estadd local time "Yes"
estadd local R2 "0.289"
eststo

*model 2
nbreg total_fatal_ind A_Mem con_grad emp_23 unem_rate emp_size emp_size_qr  i.id i.year  if year >= 2003 , vce(cluster id)
margins, dydx(_all) post
eststo

*model 3
nbreg total_fatal_ind A_Mem tot_act_union con_grad_union tot_act_non  con_grad_non  emp_23 unem_rate emp_size emp_size_qr  i.id i.year  if year >= 2003 , vce(cluster id)
estadd local state "Yes"
estadd local time "Yes"
estadd local R2 "0.291"
eststo

*model 4
nbreg total_fatal_ind A_Mem tot_act_union con_grad_union tot_act_non  con_grad_non  emp_23 unem_rate emp_size emp_size_qr  i.id i.year  if year >= 2003 , vce(cluster id)
margins, dydx(_all) post
eststo


esttab using "erase.rtf", drop(*.id *.year) star(* 0.1 ** 0.05 *** 0.01) ///
order(A_Mem tot_act con_grad tot_act_union con_grad_union ///
tot_act_non  con_grad_non     emp_23  unem_rate emp_size emp_size_qr) varwidth(20) ///
coeflabels(A_Mem "Unionization Rate" tot_act "Total Active" con_grad "Total Graduate" tot_act_union "Active Union" ///
con_grad_union "Graduate Union" tot_act_non "Active Nonunion"  con_grad_non "Graduate Nonunion" ///
 unem_rate "Unemployment Rate" emp_size "Contractor Size" emp_size_qr "Contractor Size Sq." ///
emp_23 "Employment" _cons "Constant")  ///
mtitle("Model (1)" "Model (2)" "Model (3)" "Model (4)" "Model (5)" "Model (6)") scalar("time Time Control" "state State Control" "R2 Psuedo R2") ///
modelwidth(9) replace nogap nonumber